<?php
/* 
* @Author: LDF QQ 47121862
* @Date:   2014-06-05 14:29:00
* @Last Modified by:   LDF QQ 47121862
* @Last Modified time: 2014-06-05 14:37:34
*/
class NewsControl extends AuthControl{
	function index(){
		$this->news=M('news')->all();
		$this->display();
	}
	function add(){
		if(IS_POST){
			$id = M('news')->add($_POST);
			($id)?$this->success('添加快报成功'):$this->error('添加失败');
		}else{
			$this->display();
		}
	}
	function del(){
		$id = M('news')->del(Q('nid',0,'intval'));
		$id?$this->success('删除成功'):$this->error('删除失败');
	}
}